package tq.com.systools.system;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

public class AlertDialogHelper {
    static public void show(Context pContext, String message){
        if(pContext == null) return;

        new AlertDialog.Builder(pContext).setMessage(message)
                .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                }).setCancelable(false)
                .show();
    }

    static public void show(Context pContext, String message, final ISumbimtListener pISumbimtListener){
        if(pContext == null) return;

        new AlertDialog.Builder(pContext).setMessage(message).setCancelable(false)
                .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        if(pISumbimtListener != null){
                            pISumbimtListener.ok();
                        }
                    }
                }).setNegativeButton("取消", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {

            }
        }).show();
    }

    public interface ISumbimtListener{
        void ok();
    }
}
